package com.by;

/**
 * Hello world!
 *
 */
import com.by.base.SimpleMapper;
import com.by.pojo.user;

import java.util.List;

public class TestMyBatisPlus {
    public static void main(String[] args) {
        SimpleMapper<user> userMapper = new SimpleMapper<>(user.class);

        // 插入测试
        user user = new user();
        user.setName("Java");
        user.setAge(25);
        userMapper.insert(user);

        // 查询测试
        com.by.pojo.user insertedUser = userMapper.selectById(1);
        System.out.println("Inserted User: " + insertedUser);

        // 查询所有
        List<com.by.pojo.user> users = userMapper.selectList();
        System.out.println("All Users: " + users);
    }
}
